﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <script type="text/javascript" src="<%=request.getContextPath() %>/ckeditor/ckeditor.js"></script>
</head>
<body>
<form name="dataFrm" id="dataFrm" action="/newsServlet?action=change&id=${newsByid.id}" method="post">
    <table width="100%" border="0" cellspacing="5" cellpadding="0">
        <thead>
        <tr>
            <td align="center" colspan="2" class="text_tabledetail2">增加新闻</td>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td style="text-align:right;" class="text_tabledetail2">分类</td>
            <td style="text-align:left;">
                <!-- 列出所有的新闻分类 -->
                <select name="categoryId">
                    <option value="1" <c:if test="${newsByid.categoryId==1}">selected</c:if>>国内</option>
                    <option value="2" <c:if test="${newsByid.categoryId==2}">selected</c:if>>>国际</option>
                    <option value="3" <c:if test="${newsByid.categoryId==3}">selected</c:if>> >娱乐</option>
                    <option value="4" <c:if test="${newsByid.categoryId==4}">selected</c:if>>>军事</option>
                    <option value="5" <c:if test="${newsByid.categoryId==5}">selected</c:if>> >财经</option>
                    <option value="6" <c:if test="${newsByid.categoryId==6}">selected</c:if>>>天气</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="text-align:right;" class="text_tabledetail2">标题</td>
            <td style="text-align:left;"><input type="text" name="title" value="${newsByid.title}"/></td>
        </tr>
        <tr>
            <td style="text-align:right;" class="text_tabledetail2">作者</td>
            <td style="text-align:left;"><input type="text" name="author"value="${newsByid.author}"/></td>
        </tr>

        <tr>
            <td style="text-align:right;" class="text_tabledetail2">摘要</td>
            <td style="text-align:left;"><textarea id="summary" name="summary" rows="8" cols="50">${newsByid.summary}</textarea></td>
        </tr>
        <tr>
            <td style="text-align:right;" class="text_tabledetail2">内容</td>
            <td style="text-align:left;">
                <div id="xToolbar"></div>
                <textarea id="newscontent" name="newscontent" rows="8" cols="30" class="ckeditor">${newsByid.content}</textarea></td>
        </tr>
        <tr>
            <td style="text-align:center;" colspan="2">
                <button type="submit" class="page-btn" name="save">保存</button>
                <button type="button" class="page-btn" name="return"
                        onclick="javascript:location.href='newsDetailList.jsp'">返回
                </button>
            </td>
        </tr>
        </tbody>
    </table>
</form>
</body>
</html>